<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module REXML::StreamListener - rexml: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-attlistdecl">#attlistdecl</a>
    <li ><a href="#method-i-cdata">#cdata</a>
    <li ><a href="#method-i-comment">#comment</a>
    <li ><a href="#method-i-doctype">#doctype</a>
    <li ><a href="#method-i-doctype_end">#doctype_end</a>
    <li ><a href="#method-i-elementdecl">#elementdecl</a>
    <li ><a href="#method-i-entity">#entity</a>
    <li ><a href="#method-i-entitydecl">#entitydecl</a>
    <li ><a href="#method-i-instruction">#instruction</a>
    <li ><a href="#method-i-notationdecl">#notationdecl</a>
    <li ><a href="#method-i-tag_end">#tag_end</a>
    <li ><a href="#method-i-tag_start">#tag_start</a>
    <li ><a href="#method-i-text">#text</a>
    <li ><a href="#method-i-xmldecl">#xmldecl</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-REXML::StreamListener">
    <h1 id="module-REXML::StreamListener" class="module">
      module REXML::StreamListener
    </h1>

    <section class="description">
    
<p>A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; <a href="../REXML.html"><code>REXML</code></a> doesn’t yet handle doctype entity declarations, so you have to parse them out yourself.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-attlistdecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attlistdecl</span><span
                                class="method-args">(element_name, attributes, raw_content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>If a doctype includes an ATTLIST declaration, it will cause this method to be called.  The content is the declaration itself, unparsed. EG, &lt;!ATTLIST el attr CDATA REQUIRED&gt; will come to this method as “el attr CDATA REQUIRED”.  This is the same for all of the .*decl methods.</p>

                              <div class="method-source-code" id="attlistdecl-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 51</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attlistdecl</span> <span class="ruby-identifier">element_name</span>, <span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">raw_content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cdata" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cdata</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when &lt;![CDATA[ … ]]&gt; is encountered in a document. @p content “…”</p>

                              <div class="method-source-code" id="cdata-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 83</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cdata</span> <span class="ruby-identifier">content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-comment" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">comment</span><span
                                class="method-args">(comment)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when a comment is encountered. @p comment The content of the comment</p>

                              <div class="method-source-code" id="comment-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">comment</span> <span class="ruby-identifier">comment</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doctype" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doctype</span><span
                                class="method-args">(name, pub_sys, long_name, uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Handles a doctype declaration. Any attributes of the doctype which are not supplied will be nil.  # EG, &lt;!DOCTYPE me PUBLIC “foo” “bar”&gt; @p name the name of the doctype; EG, “me” @p pub_sys “PUBLIC”, “SYSTEM”, or nil.  EG, “PUBLIC” @p long_name the supplied long name, or nil.  EG, “foo” @p uri the uri of the doctype, or nil.  EG, “bar”</p>

                              <div class="method-source-code" id="doctype-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 41</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doctype</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">pub_sys</span>, <span class="ruby-identifier">long_name</span>, <span class="ruby-identifier">uri</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doctype_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doctype_end</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when the doctype is done</p>

                              <div class="method-source-code" id="doctype_end-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 44</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doctype_end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-elementdecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">elementdecl</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>&lt;!ELEMENT …&gt;</p>

                              <div class="method-source-code" id="elementdecl-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 54</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">elementdecl</span> <span class="ruby-identifier">content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-entity" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">entity</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when %foo; is encountered in a doctype declaration. @p content “foo”</p>

                              <div class="method-source-code" id="entity-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entity</span> <span class="ruby-identifier">content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-entitydecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">entitydecl</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>&lt;!ENTITY …&gt; The argument passed to this method is an array of the entity declaration.  It can be in a number of formats, but in general it returns (example, result):</p>

<pre>&lt;!ENTITY % YN &#39;&quot;Yes&quot;&#39;&gt;
[&quot;YN&quot;, &quot;\&quot;Yes\&quot;&quot;, &quot;%&quot;]
&lt;!ENTITY % YN &#39;Yes&#39;&gt;
[&quot;YN&quot;, &quot;Yes&quot;, &quot;%&quot;]
&lt;!ENTITY WhatHeSaid &quot;He said %YN;&quot;&gt;
[&quot;WhatHeSaid&quot;, &quot;He said %YN;&quot;]
&lt;!ENTITY open-hatch SYSTEM &quot;http://www.textuality.com/boilerplate/OpenHatch.xml&quot;&gt;
[&quot;open-hatch&quot;, &quot;SYSTEM&quot;, &quot;http://www.textuality.com/boilerplate/OpenHatch.xml&quot;]
&lt;!ENTITY open-hatch PUBLIC &quot;-//Textuality//TEXT Standard open-hatch boilerplate//EN&quot; &quot;http://www.textuality.com/boilerplate/OpenHatch.xml&quot;&gt;
[&quot;open-hatch&quot;, &quot;PUBLIC&quot;, &quot;-//Textuality//TEXT Standard open-hatch boilerplate//EN&quot;, &quot;http://www.textuality.com/boilerplate/OpenHatch.xml&quot;]
&lt;!ENTITY hatch-pic SYSTEM &quot;../grafix/OpenHatch.gif&quot; NDATA gif&gt;
[&quot;hatch-pic&quot;, &quot;SYSTEM&quot;, &quot;../grafix/OpenHatch.gif&quot;, &quot;gif&quot;]</pre>

                              <div class="method-source-code" id="entitydecl-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 72</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entitydecl</span> <span class="ruby-identifier">content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-instruction" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">instruction</span><span
                                class="method-args">(name, instruction)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when an instruction is encountered.  EG: &lt;?xsl sheet=‘foo’?&gt; @p name the instruction name; in the example, “xsl” @p instruction the rest of the instruction.  In the example, “sheet=‘foo’”</p>

                              <div class="method-source-code" id="instruction-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">instruction</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">instruction</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-notationdecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">notationdecl</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>&lt;!NOTATION …&gt;</p>

                              <div class="method-source-code" id="notationdecl-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 75</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notationdecl</span> <span class="ruby-identifier">content</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tag_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_end</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when the end tag is reached.  In the case of &lt;tag/&gt;, <a href="StreamListener.html#method-i-tag_end"><code>tag_end</code></a> will be called immediately after <a href="StreamListener.html#method-i-tag_start"><code>tag_start</code></a> @p the name of the tag</p>

                              <div class="method-source-code" id="tag_end-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_end</span> <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tag_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_start</span><span
                                class="method-args">(name, attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when a tag is encountered. @p name the tag name @p attrs an array of arrays of attribute/value pairs, suitable for use with assoc or rassoc.  IE, &lt;tag attr1=“value1” attr2=“value2”&gt; will result in <a href="StreamListener.html#method-i-tag_start"><code>tag_start</code></a>( “tag”, # [[“<a href=""attr2","value2"">attr1”,“value1”],</a>])</p>

                              <div class="method-source-code" id="tag_start-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 14</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_start</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">attrs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-text" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">text</span><span
                                class="method-args">(text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when text is encountered in the document @p text the text content.</p>

                              <div class="method-source-code" id="text-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">text</span> <span class="ruby-identifier">text</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-xmldecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">xmldecl</span><span
                                class="method-args">(version, encoding, standalone)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Called when an XML PI is encountered in the document. EG: &lt;?xml version=“1.0” encoding=“utf”?&gt; @p version the version attribute value.  EG, “1.0” @p encoding the encoding attribute value, or nil.  EG, “utf” @p standalone the standalone attribute value, or nil.  EG, nil</p>

                              <div class="method-source-code" id="xmldecl-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/streamlistener.rb, line 90</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">xmldecl</span> <span class="ruby-identifier">version</span>, <span class="ruby-identifier">encoding</span>, <span class="ruby-identifier">standalone</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

